home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / menu / syslinux.c < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-14  |  1.3 KB  |  55 lines

  1. /* -*- c -*- ------------------------------------------------------------- *
  2.  *
  3.  *   Copyright 2004 Murali Krishnan Ganapathy - All Rights Reserved
  4.  *
  5.  *   This program is free software; you can redistribute it and/or modify
  6.  *   it under the terms of the GNU General Public License as published by
  7.  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
  8.  *   Boston MA 02111-1307, USA; either version 2 of the License, or
  9.  *   (at your option) any later version; incorporated herein by reference.
  10.  *
  11.  * ----------------------------------------------------------------------- */
  12.  
  13. #include "syslinux.h"
  14. #include "biosio.h"
  15.  
  16. static inline int asm_issyslinux(void)
  17. {
  18.   unsigned long eax, ebx, ecx, edx;
  19.  
  20.   eax = 0x00003000;
  21.   ebx = ecx = edx = 0xFFFFFFFF;
  22.  
  23.   asm("int $0x21"
  24.       : "+a" (eax), "+b" (ebx), "+c" (ecx), "+d" (edx));
  25.  
  26.   return (eax == 0x59530000) && (ebx == 0x4c530000) &&
  27.     (ecx == 0x4e490000) && (edx == 0x58550000);
  28. }
  29.  
  30. int issyslinux(void)
  31. {
  32.    return asm_issyslinux();
  33. }
  34.  
  35. static inline void asm_runcommand(const char *cmd)
  36. {
  37.   asm volatile("int $0x22" : : "a" (0x0003), "b" (cmd));
  38. }
  39.  
  40. void runcommand(const char *cmd)
  41. {
  42.    asm_runcommand(cmd); 
  43. }
  44.  
  45. static inline void asm_gototxtmode(void)
  46. {
  47.   asm volatile("int $0x22" : : "a" (0x0005));
  48. }
  49.    
  50. void gototxtmode()
  51. {
  52.    asm_gototxtmode();
  53. }
  54.  
  55.